#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
//	FILE *fp;
//	fp = fopen("E:\\file_0616.txt", "r");   //打开文件
//	printf("fp=========%p\n", fp);
//	fseek(fp, 0, SEEK_SET);                                     //设置fp的偏移位置
//	int fileSize;
//	fileSize = ftell(fp);                                       //获取fp的位置
//	printf("fileSize=====%d\n", fileSize);
//	char *strText;
//	strText = (char*)malloc(fileSize * sizeof(char));
//	//memset(strText, '\0', fileSize*sizeof(char));
//	fread(strText, fileSize, sizeof(char), fp);
//	strText[fileSize] = '\0';
//	printf("strText=====%s\n", strText);
//	return 0;.

	FILE *fp = fopen("E:\\file_0616.txt", "rb");
	char *str;
	str = (char *)malloc(sizeof(char) * 1024);
	while (fgets(str, 1024, fp) != NULL) {
		printf("%s ", str);
	}
	printf("\n");
	free(str);
	fclose(fp);

	FILE *fp2 = fopen("E:\\Demo1.mot", "rb");
	char *str2;
	str2 = (char *)malloc(sizeof(char) * 1024);
	while (fgets(str2, 1024, fp) != NULL) {
		printf("%s", str2);
	}
	printf("\n");
	free(str2);
	fclose(fp2);

	return 0;
}
